/*
 * © 2010 Autodata Solutions Company. All Rights Reserved
 * This source code is the confidential and proprietary information of Autodata Solutions Company.
 * The user shall not, in whole or in part, copy, publish, disclose or make any use of this source code
 * without the prior written consent of Autodata Solutions Company.
 */
Ext.ns('net.autodata.modelwalk');
(function () {
	
	/**
	 * This view defines a layout (for the ModelWalkPanel) to be used within Ext.Button Menus
	 * @class ModelWalkMenuView
	 * @extends net.autodata.modelwalk.ModelWalkView
	 * @namespace net.autodata.modelwalk
	 */
	var View = Ext.extend(net.autodata.modelwalk.ModelWalkView, {
		
		cls: 'modelwalk-vehiclesel-view',
		
		modelYearWidth: 100,
		comboWidth: 162,
		
		/**
		 * @method init
		 */
		init: function ()
		{
			View.superclass.init.apply(this, arguments);
		},
		
		/**
		 * @method initTemplates
		 */
		initTemplates: function ()
		{
			var tpls = this.templates || {};
						
			if (tpls.mainTpl === undefined) {
				tpls.mainTpl = new Ext.Template(
					'<div class="modelwalk-view {viewCls}">',
						'<dl>',
							'<dt class="modelyear">' + ASC.message('net.autodata.modelwalk.label.modelYear') + '</dt>',
							'<dd class="modelyear-wrap"></dd>',
							'<dt class="make">' + ASC.message('net.autodata.modelwalk.label.make') + '</dt>',
							'<dd class="make-wrap"></dd>',
							'<dt class="model">' + ASC.message('net.autodata.modelwalk.label.model') + '</dt>',
							'<dd class="model-wrap"></dd>',
							'<dt class="trim">' + ASC.message('net.autodata.modelwalk.label.trim') + '</dt>',
							'<dd class="trim-wrap"></dd>',					
						'</dl>', 
					'</div>',
					{
						compiled: true,
						disableFormats: true
				});
			}
			
			this.templates = tpls;
			
			View.superclass.initTemplates.apply(this, arguments);			
		},
		
		render: function ()
		{
			var panel = this.component;
			
			panel.modelYear.setWidth(this.modelYearWidth);
			panel.make.setWidth(this.comboWidth);
			panel.model.setWidth(this.comboWidth);
			panel.trim.setWidth(this.comboWidth);
			//panel.trim.minListWidth = this.comboWidth;
			
			View.superclass.render.apply(this, arguments);
		}
	});
	
	net.autodata.modelwalk.VehicleSelectorModelWalkView = View;
})();